<?php session_start();
include "constants.php";
$dates=date_create(CUTOFFS);
$cutoffdates=date_format($dates,"m/d/Y");
$displays=SHOWOFFS;
$INITIALS=SPOINT;


$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); 

if (!$link) { 
    die('Could not connect: ' . mysql_error()); 
} 

mysql_select_db(DB_NAME);

	$Profiles = "SELECT * FROM Profiles WHERE ProfileID = '$_POST[FNAME]'";
	$ProfResu = mysql_query($Profiles,$link);
	$rowProf = mysql_fetch_array($ProfResu);
	$FirstName=$rowProf['FirstName'];
	$LastName=$rowProf['LastName'];
	$Gender=$rowProf['Gender'];
	$BirthDate=$rowProf['BirthDate'];
	$Address=$rowProf['Address'];
	$City=$rowProf['City'];
	$Province=$rowProf['Province'];
	$PostCode=$rowProf['PostCode'];
	$DateIn=$rowProf['DateIn'];
	$PrimaryPhone=$rowProf['PrimaryPhone'];
	$WorkPhone=$rowProf['WorkPhone'];
	$CellPhone=$rowProf['CellPhone'];
	$Email=$rowProf['Email'];
	$Advertisement=$rowProf['Advertisement'];
	$SIN=$rowProf['SIN'];
	$DriverLicense=$rowProf['DriverLicense'];
	$R1Name=$rowProf['R1Name'];
	$R2Name=$rowProf['R2Name'];
	$R1Phone=$rowProf['R1Phone'];
	$R2Phone=$rowProf['R2Phone'];
	$R1Relation=$rowProf['R1Relation'];
	$Refuse=$rowProf['Credit'];
	$RefTimes=$rowProf['CreditNum'];
	$LatestDates=$rowProf['LastDateCredit'];
	$Reasons=$rowProf['Reasons'];

	$RefusePro = "SELECT * FROM REASONS WHERE RID = '$Reasons'";
	$Profresu = mysql_query($RefusePro,$link);
	$rowre = mysql_fetch_array($Profresu);
	$Reason=$rowre['REASONS'];

	$sql = "SELECT * FROM Applications WHERE ProfileID = '$_POST[FNAME]'";
	$result = mysql_query($sql,$link);
	$rows = mysql_fetch_array($result);
	$DebitID=$rows['DebitID'];
	$AccountID=$rows['AccountID'];

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Cash2u.ca: Payday loan appliant's Profile Details</title>
<META NAME="Description" CONTENT=Cash2u.ca offers online payday loans and cash advance for Canadians">

</head>
<body>
<div id="maincontainer">

<div id="content">
        <div id="TopSectionWrapper" class="PersonalInfo">
	<!--Starting of Personal Information Section-->
	<div id="TitleInfo" class="TitleInfo"><h2>Details of Applicant Profile</h2></div>
	<form name="Profiles" method="post" action="applysecondpart.php" id="Profiles">
	<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;">
	<tr>
        <td width="140" align="right">First Name:</td>
        <td width="170"><input type="text" style="width: 150px;" value="<?php echo $FirstName;?>" readonly></td>
        <td width="230" align="right">Last Name:</td>
        <td width="160"><input type="text" style="width: 150px;" readonly value="<?php echo $LastName;?>"></td>
	</tr>
		
	<tr>
        <td width="140" align="right">Gender:</td>
        <td width="170"><input type="text" style="width: 150px;" value="<?php echo $Gender;?>" readonly></td>
        <td width="230" align="right">Social Insurance Number:<br/><span style="color:green;font-size:small;">(SIN: 999-999-999)</span></td>
        <td width="160"><input type="text" style="width: 150px;" readonly value="<?php echo $SIN;?>"></td>
	</tr>
				
	<tr>
        <td width="140" align="right">Date of Birth:<br/><span style="color:green;font-size:small;">(date: mm/dd/yyyy)</span></td>
        <td width="170"><input type="text" style="width: 150px;" value="<?php echo $BirthDate;?>" readonly/></td>
        <td width="230" align="right">Address:</td>
        <td width="160"><input type="text" style="width: 150px;" readonly value="<?php echo $Address;?>"></td>
	</tr>

	<tr>
        <td width="140" align="right">City:</td>
        <td width="170"><input type="text" style="width: 150px;" value="<?php echo $City;?>"/></td>
        <td width="230" align="right">Province:</td>
        <td width="160"><input type="text" style="width: 150px;" readonly value="<?php echo $Province;?>"></td>
	</tr>


	<tr>
        <td width="140" align="right">Post Code:<br/><span style="color:green;font-size:small;">(Post Code:A9A-9A9)</span></td>
        <td width="170"><input type="text" readonly style="width: 150px;" value="<?php echo $PostCode;?>"/></td>
        <td width="230" align="right">When did you move in:<br/><span style="color:green;font-size:small;">(Date: mm/dd/yyyy)</span></td>
        <td width="160"><input type="text" style="width: 150px;" readonly value="<?php echo $DateIn;?>"></td>
	</tr>

	<tr>
        <td width="140" align="right">Primary Phone:<br/><span style="color:green;font-size:small;">(Tel: (999) 999-9999)</span></td>
        <td width="170"><input type="text" readonly value="<?php echo $PrimaryPhone;?>" style="width: 150px;"/></td>
        <td width="230" align="right">Work Phone:<br/><span style="color:green;font-size:small;">(Tel: (999) 999-9999x99999)</span></td>
        <td width="160"><input type="text" readonly value="<?php echo $WorkPhone;?>" style="width: 150px;"></td>
	</tr>

	<tr>
        <td width="140" align="right">Cell Phone <span style="color:green;font-size:small;">(optional):<br/>(Tel: (999) 999-9999)</span></td>
        <td width="170"><input type="text" readonly value="<?php echo $CellPhone;?>" style="width: 150px;"/></td>
        <td width="230" align="right">Driver License/Health Card #:</td>
        <td width="160"><input type="text" readonly value="<?php echo $DriverLicense;?>" style="width:150px;"></td>
	</tr>

	<tr>
        <td width="140" align="right">Reference #1 Name:</td>
        <td width="170"><input type="text" readonly value="<?php echo $R1Name;?>" style="width: 150px;"/></td>
        <td width="230" align="right">Reference #2 Name:<br/><span style="color:green;font-size:small;">(optional)</span></td>
        <td width="160"><input type="text" readonly value="<?php echo $R2Name;?>" style="width: 150px;"></td>
	</tr>
		
	<tr>
        <td width="140" align="right">Reference #1 Phone:<br/><span style="color:green;font-size:small;">(required)</span></td>
        <td width="170"><input type="text" readonly value="<?php echo $R1Phone;?>" style="width: 150px;"/><br/><span style="color:green;font-size:small;">(Tel: (999) 999-9999 x 99999)</span></td>
        <td width="230" align="right">Reference #2 Phone (optional):<br/><span style="color:green;font-size:small;">(Tel: (999) 999-9999x99999)</span></td>
        <td width="160"><input type="text" readonly value="<?php echo $R2Phone;?>" style="width: 150px;" ></td>
	</tr>


	<tr>
        <td width="140" align="right">Relationship :<br/><span style="color:green;font-size:small;">(with Reference  #1)</span></td>
        <td width="170"><input type="text" readonly value="<?php echo $R1Relation;?>" style="width: 150px;"/></td>
        <td width="230" align="right">Where did you know:<br/><span style="color:green;font-size:small;">(www.cash2u.ca)</span></td>
        <td width="160"><input type="text" readonly value="<?php echo $Advertisement;?>" style="width: 150px;"></td>
	</tr>

	<tr>
        <td width="140" align="right">Refused or not:</td>
        <td width="170"><input type="text" readonly value="<?php echo $Refuse;?>" style="width: 150px;"/></td>
        <td width="230" align="right">Refused Times:</td>
        <td width="160"><input type="text" readonly value="<?php echo $RefTimes;?>" style="width: 150px;"></td>
	</tr>

	<tr>
        <td width="140" align="right">Refused Reason:</td>
        <td width="170"><input type="text" readonly style="width: 150px;" value="<?php echo $Reason;?>"/></td>
        <td width="230" align="right">Latest Date when refused:<br/><span style="color:green;font-size:small;">(Date: mm/dd/yyyy)</span></td>
        <td width="160"><input type="text" style="width: 150px;" readonly value="<?php echo $LatestDates;?>"></td>
	</tr>

	</table>	
	
	</form>
<br/>
<br/>
<?php if($displays==1) { ?>
	<form name="Checkinformation" method="post">
	<table>	
	<tr><td width="500" align="Left">How many accountids for this applicant</td>
    	<td width="200" align="center">  
	    <select style="width: 220px;" name="accountid">        
        	<option value="0">--AccountID--</option>        
        	<?php        
       		$sql = "SELECT * FROM Applications WHERE ProfileID = '$_POST[FNAME]'";
	        $accounts = mysql_query($sql,$link);        
        	while($row = mysql_fetch_array($accounts)) {        
	            echo ("<option value=\"$row[AccountID]\" " .">$row[AccountID]</option>");  }  ?>        
	 </select></td></tr>  

	<tr><td width="500" align="Left">How many accounts for the DebitID</td>
    	<td width="200" align="center">  
	    <select style="width: 220px;" name="accountid">        
        	<option value="0">--AccountID--</option>        
        	<?php        
       		$sql = "SELECT * FROM Applications WHERE DebitID = '$DebitID'";
	        $accounts = mysql_query($sql,$link);        
        	while($row = mysql_fetch_array($accounts)) {        
	            echo ("<option value=\"$row[AccountID]\" " .">$row[AccountID]</option>");  }  ?>        
	 </select></td></tr>  
	<tr><td width="500" align="Left">How many ProfileIDs for the SIN</td>
    	<td width="200" align="center">  
	    <select style="width: 220px;" name="accountid">        
        	<option value="0">--AccountID--</option>        
        	<?php        
       		$sql = "SELECT * FROM Profiles WHERE SIN = '$SIN'";
	        $accounts = mysql_query($sql,$link);        
        	while($row = mysql_fetch_array($accounts)) {        
	            echo ("<option value=\"$row[ProfileID]\" " .">$row[ProfileID]</option>");  }  ?>        
	 </select></td></tr>  

	</table>
	</form>
<?php } ?>
	<form name="Popuinformation" method="post" action="populateinformation.php" target="_blank">
	<table>
		<tr>
		<td width="200" align="Left">Email to check details</td>
		<td width="200"><input type="text" name="emails"></td>
		</tr>  
		<tr>
		<td width="200" align="Left">Accountid to check details</td>
		<td width="200"><input type="text" name="accountid"></td>
		</tr>  		
		<tr>
		<td width="200" align="Left">Profileid to check details</td>
		<td width="200"><input type="text" name="profileid"></td>
		</tr>  
		<tr>
		<td width="200" align="Left">SIN to check details</td>
		<td width="200"><input type="text" name="sin"></td>
		</tr>  
		<tr>
		<td width="200" align="Left">Update to Loan Paid</td>
		<td width="200"><input type="text" name="ulp"></td>
		</tr>  
		<tr>
		<td width="200" align="Left">Delete the Application</td>
		<td width="200"><input type="text" name="dta"></td>
		</tr>  
		<tr>
		<td width="200" align="Left"></td>
		<td width="200"><input type="submit" value="Submit"></td>
		</tr>  
	</table>
	</form>
	
</div>
</body>
</html>




















































































































































































































































































